import request from "../utils/request.js";

const categoryApi = {
    getList() {
        return request.get('/category')
    },
    getById(id) {
        return request.get(`/category/${id}`)
    },
    add(data) {
        return request.post('/category',data)
    },
    update(data) {
        return request.put('/category',data)
    },
    delete(id) {
        return request.delete(`/category/${id}`)
    }
}

export default  categoryApi